package com.yiji.fintech.musfinance.common.factory.gateway;

import com.yiji.fintech.musfinance.base.facade.GatewayOrderFacade;
import com.yiji.fintech.musfinance.common.domain.DepositBackDomain;
import com.yiji.fintech.musfinance.common.domain.base.BaseDomain;
import org.springframework.stereotype.Service;

/**
 * 网关充退order工厂
 * Created by ouwen@yiji.com} on 2017/10/16.
 */
@Service
public class DepositBackFactory extends AbstractFactory{
    @Override
    public GatewayOrderFacade factory(BaseDomain domain) {
        DepositBackDomain depositBackDomain = (DepositBackDomain)domain;
        GatewayOrderFacade orderFacade = new GatewayOrderFacade();//TODO
        orderFacade.setGatewayChannelApi(depositBackDomain.getOldGatewayChannelApi());
        orderFacade.setGid(domain.getGid());
        orderFacade.setMerchOrderNo(domain.getMerchOrderNo());
        orderFacade.setBizOrderNo(domain.getBizOrderNo());
        orderFacade.setPartnerId(domain.getPartnerId());
        orderFacade.setAmount(depositBackDomain.getAmount());
        return orderFacade;
    }
}
